#ifndef __CONTROL_H
#define __CONTROL_H
#endif

#define TONE_OUTPUT PA2
#define TONE_OUTPUT_PORT PORTA

uint_8 tone_state;

const uint_8 tonegenerator_not_iniitialized = 0;
const uint_8 tonegenerator_inactive = 1;
const uint_8 tonegenerator_active = 2;

float tone_midi[127];
float timed_midi_s[127]; 
uint_8 sample_hz;

void tonegenerator_init();
void tonegenerator_start();
void tonegenerator_setSampleRate(uint_8 hz);
void tonegenerator_playmidi(uint_8 midinum);
void tonegenerator_update(uint_8 ms);

uint_8 tonegenerator_getResult();